import java.io.PrintStream;

class TextOdcaOut extends OdcaOut
{
  // Public Constructor
  public TextOdcaOut(PrintStream out) { too_out = out; }

  // Private Data Members
  private PrintStream too_out;
  private static char states[] = { ' ', '*', '.', '#' };

  // Private Member Functions
  protected void startDump(int count) { }

  protected void dumpCell(int cell_value)
  {
    too_out.print(states[cell_value]);
  }

  protected void endDump() { too_out.println(""); }

  public static void main(String args[]) {
    System.out.println("Hello, world");

    Odca odca = new Odca(80);
    odca.randomize();
    odca.randomRule();

    TextOdcaOut outter = new TextOdcaOut(System.out);
    outter.dump(odca);
    odca.generate();
    outter.dump(odca);

    while(true)
      {
	odca.generate();
	outter.dump(odca);
      }
  }
}
